Skip to content

Some misc upstream fixes (mostly 516 and movement related) #5945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Mar 17, 2025

Conversation

Absolucy
Copy link
Member

@Absolucy Absolucy commented Mar 15, 2025

@Absolucy Absolucy added Process: do not merge don't merge this ffs Code: Fix fix da bug labels Mar 15, 2025
@Absolucy Absolucy marked this pull request as ready for review March 16, 2025 20:02
@Absolucy Absolucy added Process: should testmerge PR should be testmerged first Code: Improvement exactly what it says on the tin Code: TGUI Involves TGUI in some way, shape or form Process: do not merge don't merge this ffs and removed Process: do not merge don't merge this ffs Process: should testmerge PR should be testmerged first labels Mar 16, 2025
@Absolucy Absolucy marked this pull request as draft March 16, 2025 21:12
Absolucy and others added 11 commits March 16, 2025 20:23
…x length (#81869)

## About The Pull Request
There's a one character discrepancy between the maximum length in the
tgui input panel and that of the copied text, that's because
`copytext("123456", 6)` will actually return `"12345"`, cutting off the
last digit, so we need to increment the `max_length` by one if we want
the right amount of characters to be return. This is also somewhat
detailed in the DM lang "bluebook", and is in line with how
`list.Copy()` also works.


## Why It's Good For The Game
This fixes the museum password pad, which trimmed the last character of
the input because of this oversight.

## Changelog

:cl:
fix: Fixed the tgui text input trimming the last character of the input
if it hits the maximum length.
fix: This also fixes the PIN pad leading to the right wing of the museum
away mission.
/:cl:
## About The Pull Request

Title. Adds a new argument to the factory proc, the New(), adds a
variable, and changes ui_state() to return that variable. The variable
is always_state by default.

## Why It's Good For The Game
It allows custom behavior to be injected into the ui_state logic of the
basic input datums. This is good because there are circumstances where
always_state isn't acceptable. Ex. you open tgui_input_list(mob/user),
and the mob dies or is deleted. The list stays open, the contents can be
picked, despite this not being what the author wants. With this PR, you
can make sure the list closes and inputs are invalid in circumstances of
your choosing without having to completely re-make the input procs via
copypasting.
## Changelog
:cl:
code: TGUI input datums can now accept custom ui_states
/:cl:
## About The Pull Request

Fixes #79321

```dm
/datum/tgui/proc/open()
	if(!user.client)
		return FALSE
```
The TGUI window won't even `open()` and do any work if we don't have a
client, so let's just explicitly get the hell out of dodge if we don't
have a client associated with a mob in these procs. Adding a `?` to
handle the runtime in the linked issue only obfuscates the deeper issue
because of the aforementioned code snippet.

## Why It's Good For The Game

Clientless monkeys will still somehow be able to interact with stuff
through their random behavior, and this is still plausible enough to
show up on live servers every so often, so let's just patch it out
early. These alerts are meant for player user input, so if we don't have
a player, let's bounce.
## Changelog
A player would never ever notice this.
this should mirror `input() as text`, and `input() as text` has no
default max length.

Anything that needs a limited input must specifically request it to
avoid collateral damage for inputs that don't need it (like admin verbs)
## About The Pull Request
Fixes default max_lenght on TGUI input text.
Chromium ignores symbols in maxlength attribute, so instead of infinity
it was... 1.

Without setting attribute, it was literally infinite (close enough)

![image](https://github.com/user-attachments/assets/7a6c643c-c43c-4bad-bd26-b8b22145a3d9)

Closes #89331

## Why It's Good For The Game


![image](https://github.com/user-attachments/assets/8421f8af-5bf7-45bf-bd2e-1d54e3f98c6d)

## Changelog

:cl:
fix: Fixed TGUI text inputs, that's allows only 1 symbol instead
infinity
/:cl:
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

This is a REALLY hot proc, takes up to like 2% of total cpu at highpop
Let's micro it then

First, clients do not go null at random. It's not predictable per say
but it is consistent.
We can use this understanding to remove a bunch of null checks here

For loops are expensive. So rather then doing one each keyLoop, let's
cache the client's intended move direction on the client. Simplifies
some other code too

There is no sense running a turn call if it would have no effect, let's
be more intelligent about this

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
refactor: Fucks with how movement keys are handled. Please report any
bugs
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
## About The Pull Request

I was failing to clear the input removal if we had no movement So you'd
step, stop moving, and retain it

Then whenever we rotate, we continue to hold onto that removal forever.
Weird.

Handles... part of? #81501

## Changelog
:cl:
fix:Blocking movement works properly again
/:cl:
…orgot (#75103)

## About The Pull Request

Title.

## Why It's Good For The Game

I broke everything.
@Absolucy Absolucy marked this pull request as ready for review March 17, 2025 00:27
@Absolucy Absolucy removed the Process: do not merge don't merge this ffs label Mar 17, 2025
@Absolucy Absolucy merged commit 9164713 into Monkestation:master Mar 17, 2025
26 checks passed
@Absolucy Absolucy deleted the meow branch March 17, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Fix fix da bug Code: Improvement exactly what it says on the tin Code: TGUI Involves TGUI in some way, shape or form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants